package com.eastshop.adminuser.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.eastshop.adminuser.vo.AdminUser;
/**
 * 后台用户登录的Dao类
 * @author admin
 *
 */
public class AdminUserDao extends HibernateDaoSupport{

	// Dao层查找后台用户的方法
	public AdminUser find(AdminUser adminUser) {
		String hql = "from AdminUser where username = ? and password = ?";
		List<AdminUser> list = this.getHibernateTemplate().find(hql, adminUser.getUsername(), adminUser.getPassword());
		if(list != null && list.size() > 0){
			return list.get(0);
		}
		return null;
	}

}
